package actions;

import game.constants.ReferenceAction;
import interfaces.ActionInterface;
import interfaces.impl.Action;
import universe.Universe;


public class ActionActivateObject extends Action{
	
	private boolean active=false;

	@Override
	public ActionInterface cloneAction() {
		ActionActivateObject action = new ActionActivateObject();
		action.modifyAction(this);
		return action;
	}

	@Override
	public boolean processActionChild(Universe universe) {
		
		target.setActive(active);
		return true;
	}

	@Override
	public void initializeName() {
		name="Action deactivate Objet";
		
	}

	@Override
	public void initializeId() {
		id= ReferenceAction.ACTION_DEACTIVATE_OBJECT;
		
	}

	@Override
	public void modifyChild(ActionInterface action) {
		if (action instanceof ActionActivateObject){
			active = ((ActionActivateObject) action).active;
		}
		
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	
	
	

}
